|
|
|
|
|
|
|
If you compute the Y and Z coordinates of the surface in the same way, you will find that they are ControlY(0, 0) and ControlZ(0, 0). In other words, when u = v = 0, the surface coincides with the first point in the control grid. If you perform similar calculations for u = 0 and v = 1, u = 1 and v = 0, and u = 1 and v = 1, you will see that the equation includes only a single nonzero term in those cases as well. Those conditions make the surface match the control grid at all of its corners. |
|
|
|
|
|
|
|
|
Now suppose u = 0 and v = 0.5. The values for Bi,M are still 1 when i = 0 and 0 otherwise, so the equation for the surface's X coordinate becomes: |
|
|
|
|
|
|
|
|
The coordinates of this point are given by a weighted average of the coordinates of the control points. Note that the middle control point is given a greater weight than the other two. This pulls the curve toward the middle control point, though the curve will generally not reach that point. |
|
|
|
|
|
|
|
|
Similarly, other values of u and v give weighted averages of the control points. The result is a surface that follows the general shape of the control points, though it matches those points exactly only at the corners. |
|
|
|
|
|
|
|
|
The classes described earlier in this chapter display a surface by drawing curves in the surface that have constant X or Z coordinates. Finding such curves in a Bezier surface is quite difficult. A Bezier surface may twist and turn in all sorts of strange directions that do not line up nicely with the coordinate axes. |
|
|
|
|
|
|
|
|
A much easier method for displaying these surfaces is to draw curves in the surface with constant u and v parameter values. This method works well with a refined grid technique. For example, you could draw the curves where u = 0.0, 0.2, 0.4, . . ., 1.0. For each of those curves, you could let v range from 0.0 to 1.0 in steps of 0.05. |
|
|
|
|
|